/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.webcat.electronicsubmissionplugin.wizard;

import org.webcat.electronicsubmissionplugin.wizard.jtree.SubmissionTargetTree;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.JTree;
import org.webcat.electronicsubmissionplugin.wizard.jtree.SubmissionTargetModel;
import org.webcat.submitter.targets.AssignmentTarget;

/**
 * Visual implementation of the first panel of the submit wizard.
 * Logic between model and the panel is handled by the {@link SubmitWizardPanel1}.
 * @author rob44, rstodd13, samccarn
 */
public final class SubmitVisualPanel1 extends JPanel   {

    private String invalidMessage = "";
    private String[] projectsList;

    /** Creates new form SubmitVisualPanel1 */
    public SubmitVisualPanel1() {
        initComponents();
        submissionTree = new SubmissionTargetTree();
        submissionTree.setModel(new SubmissionTargetModel(null));
        jScrollPane1.setViewportView(submissionTree); // hack to get around netbeans and using a custom tree
    }

    /**
     * Sets the list of projects the view displays.
     * @param projectsList
     */
    public void setProjectsList(String[] projectsList) {
        this.projectsList = projectsList;
    }

    /**
     * Netbeans method. Sets the title of the window.
     * @return the title of the window
     */
    @Override
    public String getName() {
        return "Select Project";
    }

    /**
     * Gets the error message tied to validateFields.
     * @return the error message
     */
    public String getInvalidMessage() {
        return invalidMessage;
    }

    /**
     * Assures that all the user side requirements are met for submitting
     * an assignment (i.e, password field filled in, username filled in, etc.)
     * @return the validation status
     */
    public boolean validateFields() {
        if (projectNameLabel.getText().equals("No Project Selected.")) {
            invalidMessage = "No project selected.";
            chooseProjectButton.requestFocusInWindow();
            return false;
        }
        if (!(usernameTextField.getText().length() > 0)) {
            invalidMessage = "No username entered.";
            usernameTextField.requestFocusInWindow();
            return false;
        }
        if (!(passwordTextField.getPassword().length > 0)) {
            invalidMessage = "No password entered.";
            passwordTextField.requestFocusInWindow();
            return false;
        }
        if (!(submissionTree.getLastSelectedPathComponent() instanceof AssignmentTarget)) {
            if (submissionTree.getLastSelectedPathComponent() == null) {
                invalidMessage = "You must select an assignment.";
            } else {
                invalidMessage = "You must select an assignment, not a group.";
            }
            return false;
        }
        return true;

    }

    /**
     * Gets the label that displays the project name.
     * @return the project name label
     */
    public JLabel getProjectNameLabel() {
        return projectNameLabel;
    }

    /**
     * Gets the text field containing the username
     * @return the text field
     */
    public JTextField getUsernameTextField() {
        return usernameTextField;
    }

    /**
     * Gets the password field containing the password.
     * @return the password field
     */
    public JPasswordField getPasswordTextField() {
        return passwordTextField;
    }

    /**
     * Gets the tree displaying the submission targets
     * @return the tree
     */
    public SubmissionTargetTree getSubmissionTree() {
        return (SubmissionTargetTree) submissionTree;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        headerPanel = new javax.swing.JPanel();
        instructions = new javax.swing.JLabel();
        icon = new javax.swing.JLabel();
        projectSelectPanel = new javax.swing.JPanel();
        projectLabel = new javax.swing.JLabel();
        chooseProjectButton = new javax.swing.JButton();
        projectNamePanel = new javax.swing.JPanel();
        projectNameLabel = new javax.swing.JLabel();
        projectTreePanel = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        submitAs = new javax.swing.JLabel();
        treePanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        loginInfoPanel = new javax.swing.JPanel();
        username = new javax.swing.JLabel();
        password = new javax.swing.JLabel();
        usernameTextField = new javax.swing.JTextField();
        passwordTextField = new javax.swing.JPasswordField();
        jSeparator2 = new javax.swing.JSeparator();
        jSeparator1 = new javax.swing.JSeparator();
        bottomDisplayPanel = new javax.swing.JPanel();

        headerPanel.setBackground(new java.awt.Color(255, 255, 255));

        instructions.setFont(new java.awt.Font("Tahoma", 0, 14));
        instructions.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        org.openide.awt.Mnemonics.setLocalizedText(instructions, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.instructions.text")); // NOI18N

        icon.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        icon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/banner-nobg.png"))); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(icon, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.icon.text")); // NOI18N

        javax.swing.GroupLayout headerPanelLayout = new javax.swing.GroupLayout(headerPanel);
        headerPanel.setLayout(headerPanelLayout);
        headerPanelLayout.setHorizontalGroup(
            headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(headerPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(instructions, javax.swing.GroupLayout.PREFERRED_SIZE, 426, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(icon)
                .addContainerGap(18, Short.MAX_VALUE))
        );
        headerPanelLayout.setVerticalGroup(
            headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(headerPanelLayout.createSequentialGroup()
                .addGroup(headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(headerPanelLayout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addComponent(instructions, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(icon, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE))
                .addContainerGap())
        );

        org.openide.awt.Mnemonics.setLocalizedText(projectLabel, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.projectLabel.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(chooseProjectButton, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.chooseProjectButton.text")); // NOI18N
        chooseProjectButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                chooseProjectButtonActionPerformed(evt);
            }
        });

        projectNamePanel.setBackground(new java.awt.Color(255, 255, 255));
        projectNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        projectNameLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.projectNameLabel.text")); // NOI18N

        javax.swing.GroupLayout projectNamePanelLayout = new javax.swing.GroupLayout(projectNamePanel);
        projectNamePanel.setLayout(projectNamePanelLayout);
        projectNamePanelLayout.setHorizontalGroup(
            projectNamePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 343, Short.MAX_VALUE)
            .addGroup(projectNamePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(projectNameLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE))
        );
        projectNamePanelLayout.setVerticalGroup(
            projectNamePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 19, Short.MAX_VALUE)
            .addGroup(projectNamePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(projectNamePanelLayout.createSequentialGroup()
                    .addGap(2, 2, 2)
                    .addComponent(projectNameLabel)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        javax.swing.GroupLayout projectSelectPanelLayout = new javax.swing.GroupLayout(projectSelectPanel);
        projectSelectPanel.setLayout(projectSelectPanelLayout);
        projectSelectPanelLayout.setHorizontalGroup(
            projectSelectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(projectSelectPanelLayout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(projectLabel)
                .addGap(18, 18, 18)
                .addComponent(projectNamePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(chooseProjectButton, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18))
        );
        projectSelectPanelLayout.setVerticalGroup(
            projectSelectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(projectSelectPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(projectSelectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(projectSelectPanelLayout.createSequentialGroup()
                        .addComponent(projectLabel)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, projectSelectPanelLayout.createSequentialGroup()
                        .addGroup(projectSelectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(chooseProjectButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(projectNamePanel, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE))
                        .addGap(14, 14, 14))))
        );

        org.openide.awt.Mnemonics.setLocalizedText(submitAs, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.submitAs.text")); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(submitAs)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(submitAs)
                .addContainerGap(179, Short.MAX_VALUE))
        );

        treePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jTree1.setModel(null);
        jScrollPane1.setViewportView(jTree1);

        javax.swing.GroupLayout treePanelLayout = new javax.swing.GroupLayout(treePanel);
        treePanel.setLayout(treePanelLayout);
        treePanelLayout.setHorizontalGroup(
            treePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(treePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
                .addContainerGap())
        );
        treePanelLayout.setVerticalGroup(
            treePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(treePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
                .addContainerGap())
        );

        org.openide.awt.Mnemonics.setLocalizedText(username, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.username.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(password, org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.password.text")); // NOI18N

        usernameTextField.setText(org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.usernameTextField.text")); // NOI18N

        passwordTextField.setText(org.openide.util.NbBundle.getMessage(SubmitVisualPanel1.class, "SubmitVisualPanel1.passwordTextField.text")); // NOI18N

        javax.swing.GroupLayout loginInfoPanelLayout = new javax.swing.GroupLayout(loginInfoPanel);
        loginInfoPanel.setLayout(loginInfoPanelLayout);
        loginInfoPanelLayout.setHorizontalGroup(
            loginInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginInfoPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(loginInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(loginInfoPanelLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(username)
                        .addGap(18, 18, 18)
                        .addComponent(usernameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE))
                    .addGroup(loginInfoPanelLayout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(password)
                        .addGap(18, 18, 18)
                        .addComponent(passwordTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)))
                .addContainerGap())
        );
        loginInfoPanelLayout.setVerticalGroup(
            loginInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginInfoPanelLayout.createSequentialGroup()
                .addGroup(loginInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(username, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(usernameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(loginInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(passwordTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(password)))
        );

        javax.swing.GroupLayout projectTreePanelLayout = new javax.swing.GroupLayout(projectTreePanel);
        projectTreePanel.setLayout(projectTreePanelLayout);
        projectTreePanelLayout.setHorizontalGroup(
            projectTreePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(projectTreePanelLayout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(treePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addComponent(loginInfoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE)
        );
        projectTreePanelLayout.setVerticalGroup(
            projectTreePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(projectTreePanelLayout.createSequentialGroup()
                .addGroup(projectTreePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(treePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(loginInfoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout bottomDisplayPanelLayout = new javax.swing.GroupLayout(bottomDisplayPanel);
        bottomDisplayPanel.setLayout(bottomDisplayPanelLayout);
        bottomDisplayPanelLayout.setHorizontalGroup(
            bottomDisplayPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 519, Short.MAX_VALUE)
        );
        bottomDisplayPanelLayout.setVerticalGroup(
            bottomDisplayPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 65, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(headerPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(projectSelectPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(projectTreePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE))
                        .addContainerGap())))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(bottomDisplayPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(headerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(projectSelectPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(projectTreePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bottomDisplayPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Action performed when the choose button is clicked.
     * Displays a window allowing the user to select the project they wish to submit.
     * @param evt the action event
     */
    private void chooseProjectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chooseProjectButtonActionPerformed
        // more stuff
        if (projectsList.length < 1) {
            JOptionPane.showMessageDialog(this, "You have no projects to select from!");
            return;
        }

        Icon newIcon = new ImageIcon(getClass().getResource("/icons/submit_folder.gif"));
        String s = (String) JOptionPane.showInputDialog(
                this,
                "Select a project to submit:",
                "Project Select",
                JOptionPane.PLAIN_MESSAGE,
                newIcon,
                projectsList,
                projectsList[0]);

        if ((s != null) && (s.length() > 0)) {
            projectNameLabel.setText(s);
            return;
        }
        projectNameLabel.setText("No Project Selected");
    }//GEN-LAST:event_chooseProjectButtonActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel bottomDisplayPanel;
    private javax.swing.JButton chooseProjectButton;
    private javax.swing.JPanel headerPanel;
    private javax.swing.JLabel icon;
    private javax.swing.JLabel instructions;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTree jTree1;
    private javax.swing.JPanel loginInfoPanel;
    private javax.swing.JLabel password;
    private javax.swing.JPasswordField passwordTextField;
    private javax.swing.JLabel projectLabel;
    private javax.swing.JLabel projectNameLabel;
    private javax.swing.JPanel projectNamePanel;
    private javax.swing.JPanel projectSelectPanel;
    private javax.swing.JPanel projectTreePanel;
    private javax.swing.JLabel submitAs;
    private javax.swing.JPanel treePanel;
    private javax.swing.JLabel username;
    private javax.swing.JTextField usernameTextField;
    // End of variables declaration//GEN-END:variables
    private JTree submissionTree;

    
}
